package com.cn.serverline.lineicp.productionLine.service.impl;

import com.cn.serverline.lineicp.productionLine.entity.WorkingDaySystem;
import com.cn.serverline.lineicp.productionLine.mapper.WorkingDaySystemMapper;
import com.cn.serverline.lineicp.productionLine.service.IWorkingDaySystemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;


/**
 * <p>
 * 交付计划详情工作日制 服务实现类
 * </p>
 *
 * @author 郭明然
 * @since 2024-08-22
 */
@Service("WorkingDaySystemServiceImpl")
public class WorkingDaySystemServiceImpl extends ServiceImpl<WorkingDaySystemMapper, WorkingDaySystem> implements IWorkingDaySystemService {
    @Override
    public void add(WorkingDaySystem workingDaySystem) {
        this.save(workingDaySystem);
    }

    @Override
    public void del(WorkingDaySystem workingDaySystem) {
        this.removeById(workingDaySystem);
    }

    @Override
    public void edit(WorkingDaySystem workingDaySystem) {
        this.updateById(workingDaySystem);
    }

    @Override
    public WorkingDaySystem detail(WorkingDaySystem workingDaySystem) {
        return this.getById(workingDaySystem);
    }

    @Override
    public PageResult<WorkingDaySystem> findPage(WorkingDaySystem workingDaySystem) {
        LambdaQueryWrapper<WorkingDaySystem> wrapper = new LambdaQueryWrapper<>();
        // 筛选主要属性
        /* wrapper.select(WorkingDaySystem::getId, WorkingDaySystem::getPositionName, WorkingDaySystem::getCode, WorkingDaySystem::getRemark,
        WorkingDaySystem::getPositionSort, BaseEntity::getCreateTime);*/

        Page<WorkingDaySystem> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
        return PageResultFactory.createPageResult(sysRolePage);
    }
}
